flowchart TD A[TsMocapSensor] --> B[gyro] B --> C[x] B --> D[y] B --> E[z]
Mocap
Quick access
Intro
Biometry subsystem provides functions to access Mocap functionality.
Note:
Since TsMocap is a member of the device class, it cannot be used independently without an active Teslasuit device.
Class TsMocap
Provides an interface for interacting with the Teslasuit motion capture (mocap) subsystem.
This class allows for streaming motion capture data, retrieving raw sensor data, skeleton data for individual bones, and calibration.
Class methods:
start_streaming(self)Start mocap streaming for a provided device handle.
This method subscribes to the raw data and skeleton data update callbacks and starts the streaming process.
stop_streaming(self)Stop mocap streaming for a provided device handle.
This method unsubscribes from the raw data and skeleton data update callbacks and stops the streaming process.
calibrate_skeleton(self)Calibrate mocap skeleton model.
This method triggers the calibration process for the skeleton model to ensure accurate motion capture data.
get_raw_data_on_ready(self)Wait until raw mocap data is ready and retrieve it.
This method blocks until raw data is available or streaming is stopped.
Returns:
dict: A dictionary containing raw sensor data for all bones in format of TsMocapSensor structure.
get_skeleton_data_on_ready(self)Wait until skeleton mocap data is ready and retrieve it.
This method blocks until skeleton data is available or streaming is stopped.
Returns:
dict: A dictionary containing skeleton data for all bones in format of TsMocapBone structure.
get_biomechanical_angles_on_ready(self)Wait until biomechanical angles data is ready and retrieve it.
This method blocks until biomechanical angles data is available or streaming is stopped.
Returns:
dict: A dictionary containing biomechanical angles for all bones in formatTsBiomechanicalIndex:angle value.
Access to the data
These code snippets and charts are just an example of how is the data flow looks like. to know more, please visit data structures page.
Access to raw sensor data
TsMocap.get_raw_data_on_ready()[TsBone2dIndex.LeftUpperArm].gyro.xAccess to skeleton data
TsMocap.get_skeleton_data_on_ready()[TsBone2dIndex.LeftUpperArm].position.xflowchart TD A[TsMocapBone] --> B[position] B --> C[x] B --> D[y] B --> E[z]
Access to biomechanical angles
TsMocap.get_biomechanical_angles_on_ready()[TsBiomechanicalIndex.LeftElbowFlexion]flowchart TD A[TsBiomechanicalIndex] --> B[angle_value]